package com.dartfar.workflow.constant;

/**
 * 流程事件类型
 * @author 王琦
 *
 */
public class WorkflowEventType {
	//流程启动
	public static String PROCESS_START = "PROCESS_START";
	//流程结束
	public static String PROCESS_END = "PROCESS_END";
	//提交之前
	public static String SEND_BEFORE = "SEND_BEAFORE";
	//提交之后
	public static String SEND_AFTER = "SEND_AFTER";
	//回退之前
	public static String ROLLBACK_BEFORE = "ROLLBACK_BEAFORE";
	//回退之后
	public static String ROLLBACK_AFTER = "ROLLBACK_AFTER";
	//取回之前
	public static String RETURN_BEFORE = "RETURN_BEFORE";
	//取回之后
	public static String RETURN_AFTER = "RETURN_AFTER";
	//自定义事件
	public static String CUSTOM_EVENT = "CUSTOM_EVENT";
	
	//获取工作流事件名称
	public static String getWorkflowEventTypeName(String eventType){
		if(eventType.equalsIgnoreCase(PROCESS_START)){
			return "流程启动";
		}else if(eventType.equalsIgnoreCase(PROCESS_END)){
			return "流程结束";
		}else if(eventType.equalsIgnoreCase(SEND_BEFORE)){
			return "发送之前";
		}else if(eventType.equalsIgnoreCase(SEND_AFTER)){
			return "发送之后";
		}else if(eventType.equalsIgnoreCase(ROLLBACK_BEFORE)){
			return "回退之前";
		}else if(eventType.equalsIgnoreCase(ROLLBACK_AFTER)){
			return "回退之后";
		}else if(eventType.equalsIgnoreCase(RETURN_BEFORE)){
			return "取回之前";
		}else if(eventType.equalsIgnoreCase(RETURN_AFTER)){
			return "取回之后";
		}else if(eventType.equalsIgnoreCase(CUSTOM_EVENT)){
			return "自定义事件";
		}else{
			return eventType;
		}
	}
}
